.class public Lcom/instagram/a/c;
.super Ljava/lang/Object;
.source "ActionBarService.java"


# static fields
.field private static final a:Lcom/instagram/a/c;


# instance fields
.field private b:Lcom/instagram/a/a;

.field private c:Lcom/instagram/ui/widget/refresh/RefreshButton;

.field private d:Landroid/view/View;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 19
    new-instance v0, Lcom/instagram/a/c;

    invoke-direct {v0}, Lcom/instagram/a/c;-><init>()V

    sput-object v0, Lcom/instagram/a/c;->a:Lcom/instagram/a/c;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 17
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static a()Lcom/instagram/a/c;
    .locals 1

    .prologue
    .line 31
    sget-object v0, Lcom/instagram/a/c;->a:Lcom/instagram/a/c;

    return-object v0
.end method

.method private c()V
    .locals 2

    .prologue
    .line 93
    iget-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    if-eqz v0, :cond_0

    .line 94
    iget-object v0, p0, Lcom/instagram/a/c;->b:Lcom/instagram/a/a;

    invoke-interface {v0}, Lcom/instagram/a/a;->d()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 95
    iget-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/instagram/ui/widget/refresh/RefreshButton;->setDisplayedChild(I)V

    .line 100
    :cond_0
    :goto_0
    return-void

    .line 97
    :cond_1
    iget-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/instagram/ui/widget/refresh/RefreshButton;->setDisplayedChild(I)V

    goto :goto_0
.end method

.method private d()V
    .locals 1

    .prologue
    .line 126
    const-string v0, "ActionBarService.action_bar_updated"

    invoke-static {v0}, Lcom/instagram/n/d;->b(Ljava/lang/String;)V

    .line 127
    return-void
.end method


# virtual methods
.method public a(Landroid/view/View;)V
    .locals 5
    .parameter

    .prologue
    const/16 v3, 0x8

    const/4 v2, 0x0

    .line 35
    iput-object p1, p0, Lcom/instagram/a/c;->d:Landroid/view/View;

    .line 37
    new-instance v0, Lcom/instagram/a/d;

    invoke-direct {v0, p0}, Lcom/instagram/a/d;-><init>(Lcom/instagram/a/c;)V

    invoke-virtual {p1, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 44
    sget v0, Lcom/facebook/aw;->action_bar_button_back:I

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 45
    iget-object v0, p0, Lcom/instagram/a/c;->b:Lcom/instagram/a/a;

    invoke-interface {v0}, Lcom/instagram/a/a;->c()Z

    move-result v0

    if-eqz v0, :cond_1

    move v0, v2

    :goto_0
    invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V

    .line 46
    new-instance v0, Lcom/instagram/a/e;

    invoke-direct {v0, p0}, Lcom/instagram/a/e;-><init>(Lcom/instagram/a/c;)V

    invoke-virtual {v1, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 54
    sget v0, Lcom/facebook/aw;->action_bar_button_refresh:I

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/instagram/ui/widget/refresh/RefreshButton;

    iput-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    .line 55
    iget-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    if-eqz v0, :cond_0

    .line 56
    iget-object v1, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    iget-object v0, p0, Lcom/instagram/a/c;->b:Lcom/instagram/a/a;

    invoke-interface {v0}, Lcom/instagram/a/a;->b()Z

    move-result v0

    if-eqz v0, :cond_2

    move v0, v2

    :goto_1
    invoke-virtual {v1, v0}, Lcom/instagram/ui/widget/refresh/RefreshButton;->setVisibility(I)V

    .line 57
    iget-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    new-instance v1, Lcom/instagram/a/f;

    invoke-direct {v1, p0}, Lcom/instagram/a/f;-><init>(Lcom/instagram/a/c;)V

    invoke-virtual {v0, v1}, Lcom/instagram/ui/widget/refresh/RefreshButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 64
    :cond_0
    invoke-direct {p0}, Lcom/instagram/a/c;->c()V

    .line 70
    sget v0, Lcom/facebook/aw;->action_bar_textview_custom_title_container:I

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;

    .line 72
    invoke-virtual {v0}, Landroid/view/ViewGroup;->removeAllViews()V

    .line 74
    invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v1

    .line 75
    iget-object v4, p0, Lcom/instagram/a/c;->b:Lcom/instagram/a/a;

    invoke-interface {v4, v1, v0}, Lcom/instagram/a/a;->a(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v4

    .line 76
    sget v1, Lcom/facebook/aw;->action_bar_textview_title:I

    invoke-virtual {p1, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 77
    if-nez v4, :cond_3

    .line 78
    iget-object v0, p0, Lcom/instagram/a/c;->b:Lcom/instagram/a/a;

    invoke-interface {v0}, Lcom/instagram/a/a;->a()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 79
    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setVisibility(I)V

    .line 84
    :goto_2
    return-void

    :cond_1
    move v0, v3

    .line 45
    goto :goto_0

    :cond_2
    move v0, v3

    .line 56
    goto :goto_1

    .line 81
    :cond_3
    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setVisibility(I)V

    .line 82
    invoke-virtual {v0, v4}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    goto :goto_2
.end method

.method public a(Lcom/instagram/a/a;)V
    .locals 0
    .parameter

    .prologue
    .line 121
    iput-object p1, p0, Lcom/instagram/a/c;->b:Lcom/instagram/a/a;

    .line 122
    invoke-direct {p0}, Lcom/instagram/a/c;->d()V

    .line 123
    return-void
.end method

.method public a(Z)V
    .locals 2
    .parameter

    .prologue
    .line 115
    iget-object v0, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    if-eqz v0, :cond_0

    .line 116
    iget-object v1, p0, Lcom/instagram/a/c;->c:Lcom/instagram/ui/widget/refresh/RefreshButton;

    if-eqz p1, :cond_1

    const/4 v0, 0x1

    :goto_0
    invoke-virtual {v1, v0}, Lcom/instagram/ui/widget/refresh/RefreshButton;->setDisplayedChild(I)V

    .line 118
    :cond_0
    return-void

    .line 116
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public b()V
    .locals 1

    .prologue
    .line 87
    iget-object v0, p0, Lcom/instagram/a/c;->d:Landroid/view/View;

    if-eqz v0, :cond_0

    .line 88
    iget-object v0, p0, Lcom/instagram/a/c;->d:Landroid/view/View;

    invoke-virtual {p0, v0}, Lcom/instagram/a/c;->a(Landroid/view/View;)V

    .line 90
    :cond_0
    return-void
.end method
